import App from './App'


// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'

// 引入路由
import router from "@/utils/router/index.js";
// 引入api
import api from '@/api/index.js'
// 引入工具类
import tools from '@/utils/tools/index.js'
// 检查是否登录
import { isLogin } from '@/utils/login/isLogin.js'
// 引入toast laoding
import { toast, loading } from '@/utils/modals/index.js';

export function createApp() {
  const app = createSSRApp(App)

  // 使用并挂载路由
	app.config.globalProperties.$routers = router

	// 使用api
	app.config.globalProperties.$api = api

	// 使用并挂载tools
	app.config.globalProperties.$tools = tools

	// 挂载isLogin
	app.config.globalProperties.$isLogin = isLogin

	// 挂载toast、loading
	app.config.globalProperties.$toast = toast
	app.config.globalProperties.$loading = loading

  return {
    app
  }
}
// #endif